<!DOCTYPE html>
<html>

  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
	<meta http-equiv="Cache-Control" content="no-siteapp" />

    <title>xmake v2.1.9版本发布，增加可视化图形菜单配置</title>
    <meta name="description" content="此版本主要增加xmake f --menu实现用户自定义图形菜单配置，界面风格类似linux的make menuconfig：更多使用说明，请阅读：文档手册。项目源码：Github, Gitee.新特性  添加del_files()接口去从已添加的文件列表中移除一些文件  添加rule(), add_rules(...">

    
    <meta name="keywords" content="xmake,lua,版本更新,tboox" /> 

    <!-- qq oauth -->
    <meta property="qc:admins" content="5211601217706727767255" />

    <!--icon -->
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
    <link rel="icon" sizes="192x192" href="/static/img/nice-highres.png" />
	<link rel="apple-touch-icon-precomposed" href="/static/img/apple-touch-icon-57x57-precomposed.png" />
	<link rel="apple-touch-icon-precomposed" sizes="72x72" href="/static/img/apple-touch-icon-72x72-precomposed.png" />
	<link rel="apple-touch-icon-precomposed" sizes="114x114" href="/static/img/apple-touch-icon-114x114-precomposed.png" />
	<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/static/img/apple-touch-icon-144x144-precomposed.png" />
	<link rel="apple-touch-icon-precomposed" sizes="180x180" href="/static/img/retinahd_icon.png" />
	<meta name="msapplication-TileImage" content="/static/img/retinahd_icon.png" />
	
    <link rel="stylesheet" href=" /css/fontawesome/css/font-awesome.min.css ">
    <link rel="stylesheet" href=" /css/main.css ">
    <link rel="canonical" href="https://tboox.org/cn/2018/02/03/update-v2.1.9/">
    <link rel="alternate" type="application/rss+xml" title="TBOOX Open Source Project" href="https://tboox.org/feed.xml ">
    <link rel="alternate" hreflang="en" href="https://tboox.org/" />
    <link rel="alternate" hreflang="zh-Hans" href="https://tboox.org/cn/" />

    <!-- css -->
    <link href="/css/reward.css" rel="stylesheet" type="text/css"> 




    <script type="text/javascript">
    function isPC(){    
        var userAgentInfo = navigator.userAgent;  
        var Agents = new Array("Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod");    
        var flag = true;    
        for (var v = 0; v < Agents.length; v++) {    
            if (userAgentInfo.indexOf(Agents[v]) > 0) { flag = false; break; }    
        }    
        return flag;    
    }
    </script>

<!-- baidu ads -->



    <!-- baidu ads -->

</head>


  <body>

    <header id="top">
    <div class="wrapper">
        <a href="/cn" class="brand">TBOOX</a>
        <button id="headerMenu" class="menu"><i class="fa fa-bars"></i></button>
        <nav id="headerNav">
            <ul>
                <li>
                    
                    <a href="/?lang=0">
                    
                        <i class="fa fa-home"></i>English
                    </a>
                </li>

                
                    
                    
                    <li>
                        
                            
                            <a href="/cn/project/">
                            
                        
                            <i class="fa fa-bookmark"></i>项目
                        </a>
                    </li>
                    
                    
                
                    
                    
                    
                
                    
                    
                    <li>
                        
                            
                            <a href="/cn/archive/">
                            
                        
                            <i class="fa fa-archive"></i>归档
                        </a>
                    </li>
                    
                    
                
                    
                    
                    
                
                    
                    
                    <li>
                        
                            
                            <a href="/cn/category/">
                            
                        
                            <i class="fa fa-th-list"></i>分类
                        </a>
                    </li>
                    
                    
                
                    
                    
                    
                
                    
                    
                    <li>
                        
                            
                            <a href="/cn/tag/">
                            
                        
                            <i class="fa fa-tags"></i>标记
                        </a>
                    </li>
                    
                    
                
                    
                    
                    
                
                    
                
                    
                    
                    <li>
                        
                            
                            <a href="/cn/docs/">
                            
                        
                            <i class="fa fa-book"></i>文档
                        </a>
                    </li>
                    
                    
                
                    
                    
                    
                
                    
                    
                    <li>
                        
                            
                            <a href="https://xmake.io/#/zh-cn/about/contact" target="_blank" >
                            
                        
                            <i class="fa fa-forumbee"></i>社区
                        </a>
                    </li>
                    
                    
                
                    
                    
                    
                
                    
                    
                    <li>
                        
                            
                            <a href="/cn/donation/">
                            
                        
                            <i class="fa fa-heart"></i>捐助
                        </a>
                    </li>
                    
                    
                
                    
                    
                    
                
                    
                    
                    <li>
                        
                            
                            <a href="/cn/about/">
                            
                        
                            <i class="fa fa-user"></i>关于
                        </a>
                    </li>
                    
                    
                
                    
                    
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                    
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            </ul>
        </nav>
    </div>
</header>



        <div class="page clearfix" post>
    <div class="left">
        <h1>xmake v2.1.9版本发布，增加可视化图形菜单配置</h1>
        <div class="label">

            <div class="label-card">
                <i class="fa fa-calendar"></i>2018-02-03
            </div>

            <div class="label-card">
                
            </div>

            <div class="label-card">
                
            </div>

            <div class="label-card">
            


<!-- <span class="point">•</span> -->
<span class="categories">
  <i class="fa fa-th-list"></i>
  
    
        <a href="/category/#xmake" title="Category: xmake" rel="category">xmake</a>
    
  

  <!-- <span class="point">•</span> -->
</span>


            </div>

            <div class="label-card">
            
<!-- <span class="point">•</span> -->
<span class="pageTag">
  <i class="fa fa-tags"></i>
  
    
        <!--a href="/tag/#xmake" title="Tag: xmake" rel="tag">xmake</a-->
        <a href="/cn/tag/#xmake" title="Tag: xmake" rel="tag">xmake</a>&nbsp;
    
        <!--a href="/tag/#lua" title="Tag: lua" rel="tag">lua</a-->
        <a href="/cn/tag/#lua" title="Tag: lua" rel="tag">lua</a>&nbsp;
    
        <!--a href="/tag/#%E7%89%88%E6%9C%AC%E6%9B%B4%E6%96%B0" title="Tag: 版本更新" rel="tag">版本更新</a-->
        <a href="/cn/tag/#版本更新" title="Tag: 版本更新" rel="tag">版本更新</a>
    
  

</span>

            </div>

        </div>
        <hr>
        <article itemscope itemtype="http://schema.org/BlogPosting">
        <p>此版本主要增加<code class="highlighter-rouge">xmake f --menu</code>实现用户自定义图形菜单配置，界面风格类似linux的<code class="highlighter-rouge">make menuconfig</code>：</p>

<p><img src="/static/img/xmake/menuconf.gif" width="60%" /></p>

<p>更多使用说明，请阅读：<a href="http://xmake.io/#/zh/">文档手册</a>。</p>

<p>项目源码：<a href="https://github.com/xmake-io/xmake">Github</a>, <a href="https://gitee.com/tboox/xmake">Gitee</a>.</p>

<h3 id="新特性">新特性</h3>

<ul>
  <li>添加<code class="highlighter-rouge">del_files()</code>接口去从已添加的文件列表中移除一些文件</li>
  <li>添加<code class="highlighter-rouge">rule()</code>, <code class="highlighter-rouge">add_rules()</code>接口实现自定义构建规则，并且改进<code class="highlighter-rouge">add_files("src/*.md", {rule = "markdown"})</code></li>
  <li>添加<code class="highlighter-rouge">os.filesize()</code>接口</li>
  <li>添加<code class="highlighter-rouge">core.ui.xxx</code>等cui组件模块，实现终端可视化界面，用于实现跟用户进行短暂的交互</li>
  <li>通过<code class="highlighter-rouge">xmake f --menu</code>实现可视化菜单交互配置，简化工程的编译配置</li>
  <li>添加<code class="highlighter-rouge">set_values</code>接口到option</li>
  <li>改进option，支持根据工程中用户自定义的option，自动生成可视化配置菜单</li>
  <li>在调用api设置工程配置时以及在配置菜单中添加源文件位置信息</li>
</ul>

<h3 id="改进">改进</h3>

<ul>
  <li>改进交叉工具链配置，通过指定工具别名定向到已知的工具链来支持未知编译工具名配置, 例如: <code class="highlighter-rouge">xmake f --cc=gcc@ccmips.exe</code></li>
  <li><a href="https://github.com/xmake-io/xmake/issues/151">#151</a>: 改进mingw平台下动态库生成</li>
  <li>改进生成makefile插件</li>
  <li>改进检测错误提示</li>
  <li>改进<code class="highlighter-rouge">add_cxflags</code>等flags api的设置，添加force参数，来禁用自动检测和映射，强制设置选项：<code class="highlighter-rouge">add_cxflags("-DTEST", {force = true})</code></li>
  <li>改进<code class="highlighter-rouge">add_files</code>的flags设置，添加force域，用于设置不带自动检测和映射的原始flags：<code class="highlighter-rouge">add_files("src/*.c", {force = {cxflags = "-DTEST"}})</code></li>
  <li>改进搜索工程根目录策略</li>
  <li>改进vs环境探测，支持加密文件系统下vs环境的探测</li>
  <li>升级luajit到最新2.1.0-beta3</li>
  <li>增加对linux/arm, arm64的支持，可以在arm linux上运行xmake</li>
  <li>改进vs201x工程生成插件，更好的includedirs设置支持</li>
</ul>

<h3 id="bugs修复">Bugs修复</h3>

<ul>
  <li>修复依赖修改编译和链接问题</li>
  <li><a href="https://github.com/xmake-io/xmake/issues/151">#151</a>: 修复<code class="highlighter-rouge">os.nuldev()</code>在mingw上传入gcc时出现问题</li>
  <li><a href="https://github.com/xmake-io/xmake/issues/150">#150</a>: 修复windows下ar.exe打包过长obj列表参数，导致失败问题</li>
  <li>修复<code class="highlighter-rouge">xmake f --cross</code>无法配置问题</li>
  <li>修复<code class="highlighter-rouge">os.cd</code>到windows根路径问题</li>
</ul>

<h3 id="新特性介绍">新特性介绍</h3>

<h4 id="新增del_files接口实现从源文件列表中删除指定文件">新增<code class="highlighter-rouge">del_files</code>接口实现从源文件列表中删除指定文件</h4>

<p>通过此接口，可以从前面<a href="http://xmake.io/#/zh/manual?id=targetadd_files">add_files</a>接口添加的文件列表中，删除指定的文件，例如：</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">target</span><span class="p">(</span><span class="s2">"test"</span><span class="p">)</span>
    <span class="n">add_files</span><span class="p">(</span><span class="s2">"src/*.c"</span><span class="p">)</span>
    <span class="n">del_files</span><span class="p">(</span><span class="s2">"src/test.c"</span><span class="p">)</span>
</code></pre>
</div>

<p>上面的例子，可以从<code class="highlighter-rouge">src</code>目录下添加除<code class="highlighter-rouge">test.c</code>以外的所有文件，当然这个也可以通过<code class="highlighter-rouge">add_files("src/*.c|test.c")</code>来达到相同的目的，但是这种方式更加灵活。</p>

<p>例如，我们可以条件判断来控制删除哪些文件，并且此接口也支持<a href="http://xmake.io/#/zh/manual?id=targetadd_files">add_files</a>的匹配模式，过滤模式，进行批量移除。</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">target</span><span class="p">(</span><span class="s2">"test"</span><span class="p">)</span>
    <span class="n">add_files</span><span class="p">(</span><span class="s2">"src/**.c"</span><span class="p">)</span>
    <span class="n">del_files</span><span class="p">(</span><span class="s2">"src/test*.c"</span><span class="p">)</span>
    <span class="n">del_files</span><span class="p">(</span><span class="s2">"src/subdir/*.c|xxx.c"</span><span class="p">)</span>
    <span class="k">if</span> <span class="n">is_plat</span><span class="p">(</span><span class="s2">"iphoneos"</span><span class="p">)</span> <span class="k">then</span>
        <span class="n">add_files</span><span class="p">(</span><span class="s2">"xxx.m"</span><span class="p">)</span>
    <span class="k">end</span>
</code></pre>
</div>

<p>通过上面的例子，我们可以看出<code class="highlighter-rouge">add_files</code>和<code class="highlighter-rouge">del_files</code>是根据调用顺序，进行顺序添加和删除的，并且通过<code class="highlighter-rouge">del_files("src/subdir/*.c|xxx.c")</code>删除一批文件，
并且排除<code class="highlighter-rouge">src/subdir/xxx.c</code>（就是说，不删除这个文件）。</p>

<h4 id="通过rule接口实现用户自定义编译规则">通过<code class="highlighter-rouge">rule()</code>接口实现用户自定义编译规则</h4>

<p>在2.1.9版本之后，xmake不仅原生内置支持多种语言文件的构建，而且还可以通过自定义构建规则，让用户自己来实现复杂的未知文件构建。</p>

<p>我们可以通过预先设置规则支持的文件后缀，来扩展其他文件的构建支持：</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="c1">-- 定义一个markdown文件的构建规则</span>
<span class="n">rule</span><span class="p">(</span><span class="s2">"markdown"</span><span class="p">)</span>
    <span class="n">set_extensions</span><span class="p">(</span><span class="s2">".md"</span><span class="p">,</span> <span class="s2">".markdown"</span><span class="p">)</span>
    <span class="n">on_build</span><span class="p">(</span><span class="k">function</span> <span class="p">(</span><span class="n">target</span><span class="p">,</span> <span class="n">sourcefile</span><span class="p">)</span>
        <span class="n">os</span><span class="p">.</span><span class="n">cp</span><span class="p">(</span><span class="n">sourcefile</span><span class="p">,</span> <span class="n">path</span><span class="p">.</span><span class="n">join</span><span class="p">(</span><span class="n">target</span><span class="p">:</span><span class="n">targetdir</span><span class="p">(),</span> <span class="n">path</span><span class="p">.</span><span class="n">basename</span><span class="p">(</span><span class="n">sourcefile</span><span class="p">)</span> <span class="o">..</span> <span class="s2">".html"</span><span class="p">))</span>
    <span class="k">end</span><span class="p">)</span>

<span class="n">target</span><span class="p">(</span><span class="s2">"test"</span><span class="p">)</span>
    <span class="n">set_kind</span><span class="p">(</span><span class="s2">"binary"</span><span class="p">)</span>
    
    <span class="c1">-- 使test目标支持markdown文件的构建规则</span>
    <span class="n">add_rules</span><span class="p">(</span><span class="s2">"markdown"</span><span class="p">)</span>

    <span class="c1">-- 添加markdown文件的构建</span>
    <span class="n">add_files</span><span class="p">(</span><span class="s2">"src/*.md"</span><span class="p">)</span>
    <span class="n">add_files</span><span class="p">(</span><span class="s2">"src/*.markdown"</span><span class="p">)</span>
</code></pre>
</div>

<p>我们也可以指定某些零散的其他文件作为markdown规则来处理：</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">target</span><span class="p">(</span><span class="s2">"test"</span><span class="p">)</span>
    <span class="c1">-- ...</span>
    <span class="n">add_files</span><span class="p">(</span><span class="s2">"src/test/*.md.in"</span><span class="p">,</span> <span class="p">{</span><span class="n">rule</span> <span class="o">=</span> <span class="s2">"markdown"</span><span class="p">})</span>
</code></pre>
</div>

<p class="tips">
通过`add_files("*.md", {rule = "markdown"})`方式指定的规则，优先级高于`add_rules("markdown")`设置的规则。
</p>

<p>我们还可以实现规则的级联构建，例如在构建man规则后，继续调用markdown规则，实现级联构建：</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">rule</span><span class="p">(</span><span class="s2">"man"</span><span class="p">)</span>
    <span class="n">add_imports</span><span class="p">(</span><span class="s2">"core.project.rule"</span><span class="p">)</span>
    <span class="n">on_build</span><span class="p">(</span><span class="k">function</span> <span class="p">(</span><span class="n">target</span><span class="p">,</span> <span class="n">sourcefile</span><span class="p">)</span>
        <span class="n">rule</span><span class="p">.</span><span class="n">build</span><span class="p">(</span><span class="s2">"markdown"</span><span class="p">,</span> <span class="n">target</span><span class="p">,</span> <span class="n">sourcefile</span><span class="p">)</span>
    <span class="k">end</span><span class="p">)</span>
</code></pre>
</div>

<p>对于有些文件，需要支持多文件构建生成单一对象的模式，可以通过<a href="http://xmake.io/#/zh/manual?id=ruleon_build_all">on_build_all</a>来实现：</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">rule</span><span class="p">(</span><span class="s2">"man"</span><span class="p">)</span>
    <span class="n">on_build_all</span><span class="p">(</span><span class="k">function</span> <span class="p">(</span><span class="n">target</span><span class="p">,</span> <span class="n">sourcefiles</span><span class="p">)</span>
        <span class="c1">-- build some source files</span>
        <span class="k">for</span> <span class="n">_</span><span class="p">,</span> <span class="n">sourcefile</span> <span class="k">in</span> <span class="nb">ipairs</span><span class="p">(</span><span class="n">sourcefiles</span><span class="p">)</span> <span class="k">do</span>
            <span class="c1">-- ...</span>
        <span class="k">end</span>
    <span class="k">end</span><span class="p">)</span>

<span class="n">target</span><span class="p">(</span><span class="s2">"test"</span><span class="p">)</span>
    <span class="c1">-- ...</span>
    <span class="n">add_files</span><span class="p">(</span><span class="s2">"src/test/*.doc.in"</span><span class="p">,</span> <span class="p">{</span><span class="n">rule</span> <span class="o">=</span> <span class="s2">"man"</span><span class="p">})</span>
</code></pre>
</div>

<h4 id="通过xmake-f---menu实现可视化菜单配置">通过<code class="highlighter-rouge">xmake f --menu</code>实现可视化菜单配置</h4>

<p>之前的版本，使用<a href="http://xmake.io/#/zh/manual?id=option">option</a>可实现命令行菜单选项的用户自定义，当工程配置相当多的情况下，采用这种命令行配置的方式就不是很灵活了。</p>

<p>因此在2.1.9版本中，我们扩展了option，使其原生支持<code class="highlighter-rouge">xmake f --menu</code>的图形化配置界面，实现复杂的分级配置，并且支持配置的模糊查找和定位，配置项目更加灵活方便。</p>

<p>我们可以通过<a href="http://xmake.io/#/zh/manual?id=optionset_category">set_category</a>设置option的分级路径名<code class="highlighter-rouge">set_category("root/submenu/submenu2")</code>，例如：</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="c1">-- 'boolean' option</span>
<span class="n">option</span><span class="p">(</span><span class="s2">"test1"</span><span class="p">)</span>
    <span class="n">set_default</span><span class="p">(</span><span class="kc">true</span><span class="p">)</span>
    <span class="n">set_showmenu</span><span class="p">(</span><span class="kc">true</span><span class="p">)</span>
    <span class="n">set_category</span><span class="p">(</span><span class="s2">"root menu/test1"</span><span class="p">)</span>

<span class="c1">-- 'choice' option with values: "a", "b", "c"</span>
<span class="n">option</span><span class="p">(</span><span class="s2">"test2"</span><span class="p">)</span>
    <span class="n">set_default</span><span class="p">(</span><span class="s2">"a"</span><span class="p">)</span>
    <span class="n">set_values</span><span class="p">(</span><span class="s2">"a"</span><span class="p">,</span> <span class="s2">"b"</span><span class="p">,</span> <span class="s2">"c"</span><span class="p">)</span>
    <span class="n">set_showmenu</span><span class="p">(</span><span class="kc">true</span><span class="p">)</span>
    <span class="n">set_category</span><span class="p">(</span><span class="s2">"root menu/test2"</span><span class="p">)</span>

<span class="c1">-- 'string' option</span>
<span class="n">option</span><span class="p">(</span><span class="s2">"test3"</span><span class="p">)</span>
    <span class="n">set_default</span><span class="p">(</span><span class="s2">"xx"</span><span class="p">)</span>
    <span class="n">set_showmenu</span><span class="p">(</span><span class="kc">true</span><span class="p">)</span>
    <span class="n">set_category</span><span class="p">(</span><span class="s2">"root menu/test3/test3"</span><span class="p">)</span>

<span class="c1">-- 'number' option</span>
<span class="n">option</span><span class="p">(</span><span class="s2">"test4"</span><span class="p">)</span>
    <span class="n">set_default</span><span class="p">(</span><span class="mi">6</span><span class="p">)</span>
    <span class="n">set_showmenu</span><span class="p">(</span><span class="kc">true</span><span class="p">)</span>
    <span class="n">set_category</span><span class="p">(</span><span class="s2">"root menu/test4"</span><span class="p">)</span>
</code></pre>
</div>

<p>上述配置最后显示的菜单界面路径结构：</p>

<ul>
  <li>root menu
    <ul>
      <li>test1</li>
      <li>test2</li>
      <li>test3
        <ul>
          <li>test3</li>
        </ul>
      </li>
      <li>test4</li>
    </ul>
  </li>
</ul>

<p>效果图如下：</p>

<p><img src="/static/img/xmake/option_set_category.gif" width="60%" /></p>

<p>并且我们还可以通过<a href="http://xmake.io/#/zh/manual?id=optionset_values">set_values</a>，提供选项值列表供用户快速选择使用，例如：</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">option</span><span class="p">(</span><span class="s2">"test"</span><span class="p">)</span>
    <span class="n">set_default</span><span class="p">(</span><span class="s2">"b"</span><span class="p">)</span>
    <span class="n">set_showmenu</span><span class="p">(</span><span class="kc">true</span><span class="p">)</span>
    <span class="n">set_values</span><span class="p">(</span><span class="s2">"a"</span><span class="p">,</span> <span class="s2">"b"</span><span class="p">,</span> <span class="s2">"c"</span><span class="p">)</span>
</code></pre>
</div>

<p>效果图如下：</p>

<p><img src="/static/img/xmake/option_set_values.png" width="60%" /></p>

<h4 id="搜索用户配置">搜索用户配置</h4>

<p><img src="/static/img/xmake/searchconf.gif" width="60%" /></p>

        </article>
        <hr>

        <!-- baidu ads -->
        

        <!-- reward -->
        <div style="text-align: center;">
            <button id="rewardButton" disable="enable" onclick="var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}">
              <span>赏</span>
            </button>
            <div id="QR" style="display: none;">
                <div id="wechat" style="display: inline-block">
                  <img id="wechat_qr" src="/static/img/weixin.png" alt="WeChat Pay"/>
                  <p>微信打赏</p>
                </div>
                <div id="alipay" style="display: inline-block">
                  <img id="alipay_qr" src="/static/img/alipay.png" alt="Alipay"/>
                  <p>支付宝打赏</p>
                </div>
            </div>
        </div>

        
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
            
                
                    
                    <h2 id="english">English</h2>
                    <ul>
                    
                    <li class="relatedPost">
                        <a href="/2018/02/03/update-v2.1.9/">xmake v2.1.9 released, provide user custom menu config
                        
                        </a>
                    </li>
                    
                    
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
        
            </ul>
        

        
        
            
        
            
            
            
                
                    
                        
                        <h2 id="similar_posts">相关文章</h2>
                        <ul>
                        
                        <li class="relatedPost">
                            <a href="/cn/2021/12/17/xmake-update-v2.6.2/">xmake v2.6.2 发布，新增 Linux 内核驱动模块构建支持
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
            
        
            
        
            
            
            
                
                    
                        
                        <li class="relatedPost">
                            <a href="/cn/2021/12/03/xmake-update-v2.6.1/">xmake v2.6.1 发布，使用 Lua5.4 运行时，Rust 和 C++ 混合编译支持
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
            
        
            
        
            
            
            
                
                    
                        
                        <li class="relatedPost">
                            <a href="/cn/2021/10/30/xmake-update-v2.5.9/">xmake v2.5.9 发布，改进 C++20 模块，并支持 Nim, Keil MDK 和 Unity Build
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
            
        
            
        
            
            
            
                
                    
                        
                        <li class="relatedPost">
                            <a href="/cn/2021/10/08/xmake-update-v2.5.8/">xmake v2.5.8 发布，新增 Pascal/Swig 程序和 Lua53 运行时支持
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
            
        
            
        
            
            
            
                
                    
                        
                        <li class="relatedPost">
                            <a href="/cn/2021/08/29/xmake-update-v2.5.7/">xmake v2.5.7 发布，包依赖锁定和 Vala/Metal 语言编译支持
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
            
        
        
            </ul>
        

        <div class="post-recent">
    <div class="pre">

        

        

        
        
        <p><strong>上一篇</strong> <a href="/cn/2017/11/13/custom-rule/">xmake 自定义构建规则的使用</a></p>
        
    </div>

    <div class="nex">

        

        

        
        
        

        

        

        
        
        <p><strong>下一篇</strong> <a href="/cn/2018/03/09/support-cuda/">xmake新增对Cuda代码编译支持</a></p>
        
    </div>
</div>


        <h2 id="comments">评论</h2>
        






<div id="gitalk-container"></div>
<link rel="stylesheet" href="/css/gitalk.css">
<script src="/js/gitalk.min.js"></script>

<script>
const gitalk = new Gitalk({
  clientID: '73946dc1d9e2276ad0da',
  clientSecret: '12a3cb94361ba3ebc6ecb68cf80d592bfaa8106d',
  repo: 'tboox.github.io',
  owner: 'waruqi',
  admin: ['waruqi'],
  id: location.pathname,       
  language: 'zh-CN',
  distractionFreeMode: false  
})

gitalk.render('gitalk-container')
</script>





    </div>
    <button class="anchor"><i class="fa fa-anchor"></i></button>
    <div class="right">
        <div class="wrap">

            <!-- codefund ads -->
            

            <!-- Content -->
            <div class="side content">
                <div>
                    内容
                </div>
                <ul id="content-side" class="content-ul">
                    <li><a href="#english">English</a></li>
                    <li><a href="#similar_posts">相关文章</a></li>
                    <li><a href="#comments">评论</a></li>
                </ul>
            </div>


            <!-- baidu ads -->
            
            
            <br>
            <div class="side">
                <div>
                    <i class="fa fa-external-link"></i>
                    链接
                </div>
                <ul class="content-ul">
                  <li><a href="http://github.com/waruqi/tbox">tbox</a></li>
                  <li><a href="http://www.xmake.io">xmake</a></li>
                  <li><a href="https://github.com/waruqi">github</a></li>
                </ul>
            </div> 

            <!-- xmake courses -->
            <br>
            <div class="side">
                <div>
                    <i class="fa fa-external-link"></i>
                    xmake 入门课程
                </div>
                <a href="https://xmake.io/#/zh-cn/about/course" target="_blank">
                <img src="/static/img/xmake-course.png" alt="course" width="256" height="193">
                </a>
            </div>

            <!-- qqgroup -->
            <br>
            <div class="side">
                <div>
                    <i class="fa fa-external-link"></i>
                    技术交流群（QQ）
                </div>
                <img src="/static/img/qqgroup.png" alt="qqgroup" width="256" height="284">
            </div> 

            <!-- google ads -->
            

            <!-- baidu ads -->
            

        </div>
    </div>

    <!-- baidu ads -->
    
</div>
<script>
/**
 * target _blank
 */
(function() {
    var aTags = document.querySelectorAll('article a:not([id])')
    for (var i = 0; i < aTags.length; i++) {
        aTags[i].setAttribute('target', '_blank')
    }
}());
</script>
<script src="/js/pageContent.js " charset="utf-8"></script>



    <footer class="site-footer">
    <div class="wrapper">
        <p class="description">
             Copyright (c) 2016-2020 tboox.org 
        </p>
        <p class="contact">
            
            <a href="https://github.com/waruqi" title="GitHub"><i class="fa fa-github" aria-hidden="true"></i></a> 
             
            
            <a href="mailto:waruqi@gmail.com" title="email"><i class="fa fa-envelope-o" aria-hidden="true"></i></a> 
            
            
            <a href="https://twitter.com/waruqi" title="Twitter"><i class="fa fa-twitter" aria-hidden="true"></i></a> 
            
            <a href="/feed.xml" title="feed"><i class="fa fa-feed" aria-hidden="true"></i></a> 
        </p>
        <p class="power">
            <span>
                Site powered by <a href="https://jekyllrb.com/">Jekyll</a> & <a href="https://github.com/Gaohaoyang">HyG</a> & <a href="https://pages.github.com/">Github Pages</a>.
            </span>
        </p>
    </div>
</footer>

    <div class="back-to-top">
    <a href="#top" class="scroll">
        <i class="fa fa-arrow-up" aria-hidden="true"></i>
    </a>
</div>

    <script src=" /js/main.js " charset="utf-8"></script>
    <script src=" /js/scroll.min.js " charset="utf-8"></script>
  </body>

</html>
